import { action, observable } from "mobx-miniprogram";
export const dynamicStore=observable({
  dynamicList:[],
  dynamicForm:{
    type:"最近",
    searchKey:"",
    page:0,
    size:5,
  },
  last:false,
  addDynamicList:action(function(list,last){
    this.dynamicList=[...this.dynamicList,...list]
    this.last=last
  }),
  setDynamicForm:action(function(form){
    this.dynamicForm={
      ...this.dynamicForm,
      ...form
    }
  }),
  resetDynamicList:action(function(){
    this.dynamicList=[]
    this.last=false
    this.setDynamicForm({page:0,size:5})
  }),
  setDynamicList:action(function(list) {
    console.log(list[0])
    this.dynamicList=list
  })
})